package org.qing.cloud.common.security.exception;

import org.qing.cloud.common.security.component.SysAuth2ExceptionSerializer;
import org.springframework.http.HttpStatus;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@JsonSerialize(using = SysAuth2ExceptionSerializer.class)
public class UnauthorizedException extends SysAuth2Exception {

	private static final long serialVersionUID = 7103591168512709382L;

	public UnauthorizedException(String msg, Throwable t) {
		super(msg);
	}

	@Override
	public String getOAuth2ErrorCode() {
		return "unauthorized";
	}

	@Override
	public int getHttpErrorCode() {
		return HttpStatus.UNAUTHORIZED.value();
	}

}
